﻿@{
    ViewBag.Title = "Định giá";
}
<script type="text/javascript">
    $(document).ready(function () {
        new SearchHelper($("#txtSearch"), $("#btnSearch"), $("#RateMapping"));
    });
</script>
<div class="section-header">
    <div class="title">
        <img src="@Url.Content("~/Areas/Administrator/Content/Images/ico-catalog.png")" alt="" />
        Định giá
    </div>
    <div class="options">
        <a href="@Url.Action("Create", "RateMapping")" class="t-button">Tạo mới</a>
    </div>
</div>
@Helpers.SearchPanel(text: "Nhập vào từ khóa tìm kiếm...", btnSearch: "btnSearch", txtSearch: "txtSearch")
@Html.Osd().HiddenPopupWindow("Cảnh Báo", Helpers.DeleteConfirmMessageBox("Bạn có thực sự muốn xóa không", @Url.Action("delete", "RateMapping", new { area = "administrator" })).ToHtmlString())
@(Html.Osd().Grid(new List<Transport.Areas.Administrator.Models.RateMappingModel>(), name: "RateMapping", controllerName: "RateMapping")
                    .Columns(columns =>
                    {
                        columns.Bound(x => x.RateMappingId).Title("MS").ClientTemplate("<a href=\"RateMapping/Edit/<#= RateMappingId #>\"><#= 10000 + RateMappingId #></a>")
                            .Width(100)
                            .Filterable(false);
                        columns.Bound(x => x.DeliverFromName).Title("Nơi Đi")
                            .Filterable(true);
                        columns.Bound(x => x.DeliverToName).Title("Nơi Đến")
                            .Width(250)
                            .Filterable(true);
                        columns.Bound(x => x.RateColumn).Title("Cột Giá")
                            .Width(200)
                            .Filterable(true);
                        columns.Bound(p => p.RateMappingId)
                            .ClientTemplate("<a onclick='onMessageBoxActionDelete(<#= RateMappingId #>)'><img src=\" ../Content/Images/delete_16_16.png\" /></a>")
                            .HtmlAttributes(new { style = "text-align:center" })
                            .Title(string.Empty)
                            .Width(100).Sortable(false)
                            .Filterable(false);
                    }).Sortable(p => p.OrderBy(o => o.Add(b => b.RateMappingId).Descending())))